using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace SoftwareBase.Handler
{
    public class Work
    {
        public long Sno { get; set; }
        public Direction Direction { get; set; }
        public string Name { get; set; }
        public IFormFile Video { get; set; }
        public IFormFile Code { get; set; }

        public async Task SaveAsync()
        {
            var video = $"{Direction}_{Sno}_{Name}.mp4";
            var code = $"{Direction}_{Sno}_{Name}.zip";
            await FileManager.SaveFileAsync(video, Video);
            await FileManager.SaveFileAsync(code, Code);
            FileManager.CompressFile(code);
        }
    }

    public enum Direction
    {
        FrontEnd,
        BackEnd,
        DataAnalyze
    }
}